<?php

namespace Common\Service;


/** 
 * 商品
 * @author Legend. <xcx_legender@qq.com>
 * @param 
 * @return 
 */
Class GiftService extends BaseService
{
	/*
	



	 */
	
	protected $_validate = array(
		array('name', 'require', '名字必须', self::MUST_VALIDATE , 'regex', self::MODEL_BOTH),
		array('type', 'require', '类型必须', self::MUST_VALIDATE , 'regex', self::MODEL_BOTH),
		array('score', 'require', '积分必须', self::MUST_VALIDATE , 'regex', self::MODEL_BOTH),
		array('score', '/^\d+$/', '积分必须为正整数', self::MUST_VALIDATE, 'regex', self::MODEL_BOTH),
		array('game_id', 'require', '游戏必须', self::MUST_VALIDATE , 'regex', self::MODEL_BOTH),
	);
	
	protected $_auto = array(
        array('name', 'htmlspecialchars', self::MODEL_BOTH, 'function'),
        array('content', 'htmlspecialchars', self::MODEL_BOTH, 'function'),
        array('flow', 'htmlspecialchars', self::MODEL_BOTH, 'function'),
        array('explain', 'htmlspecialchars', self::MODEL_BOTH, 'function'),
        array('create_time', NOW_TIME, self::MODEL_INSERT),
        array('update_time', NOW_TIME, self::MODEL_BOTH),
        array('status', 'intval', self::MODEL_BOTH, 'function'),
        array('is_recomd', 'intval', self::MODEL_BOTH, 'function'),
        array('game_id', 'intval', self::MODEL_BOTH, 'function'),
        array('stock', 0, self::MODEL_INSERT),
        array('stock', 'intval', self::MODEL_BOTH, 'function'),
        array('hot', 0, self::MODEL_INSERT),
        array('hot', 'intval', self::MODEL_BOTH, 'function'),
    );

   




}